package com.doit.day01

import org.apache.spark.rdd.RDD
import org.apache.spark.{SparkConf, SparkContext}

/**
 * @Author:
 * @WX: 17710299606
 * @Tips: 学大数据 ,到多易教育
 * @DOC: https://blog.csdn.net/qq_37933018?spm=1000.2115.3001.5343
 * @Description:
 */
object Demo06Lazy {
  def main(args: Array[String]): Unit = {
       val  conf  = new SparkConf()
             .setMaster("local[*]")
             .setAppName(this.getClass.getSimpleName)
           val sc = SparkContext.getOrCreate(conf)

    val  ls = List(1,2,3,4,5)

    val rdd1: RDD[Int] = sc.makeRDD(ls , 1)

    val rdd2 = rdd1.map(e => {
      println("hello")
      e * 10
    })


    rdd2.foreach(println)



    sc.stop()

  }

}
